<%= search_form_for [:admin, @search], class: "filter-wrap", data: {controller: "filters dialog"} do |f| %>
    <div class="d-flex flex-column flex-lg-row gap-2">
      <%= render 'spree/admin/shared/filters_search_bar', param: :name_cont, label: Spree.t(:name) %>
      <%= render "spree/admin/promotions/table_filter_dropdown" %>
      <%= button_tag type: 'button', class: 'btn btn-light d-flex align-items-center', data: { action: 'dialog#open' } do %>
        <%= icon "adjustments", class: "mr-1" %>
        <%= Spree.t("admin.filters") %>
      <% end %>
    </div>

  <dialog class="drawer" data-dialog-target="dialog" id="promotion-filters-drawer">
    <%= drawer_header(Spree.t(:filter), 'dialog') %>
    <div class="drawer-body">
        <div class="form-group">
          <%= label_tag :q_code_or_coupon_codes_code_eq, Spree.t(:code) %>
          <%= f.search_field :code_or_coupon_codes_code_eq, class: "form-control", data: { filters_target: :input } %>
        </div>
      <%= render_admin_partials(:promotions_filters_partials, f: f) %>
    </div>
    <div class="drawer-footer">
      <%= drawer_discard_button('dialog') %>
      <%= render 'spree/admin/shared/filter_submit' %>
    </div>
  </dialog>

  <%= render "spree/admin/shared/filter_badge_template" %>

  <div data-filters-target="badgesContainer" class="filter-badges-container"></div>
<% end %>